import request from "@/utils/request";

// 查询设备列表
export function getSbList(data) {
  return request({
    url: "/equipment/ledger/list",
    method: "post",
    data,
  });
}
// 新增设备
export function addSb(data) {
  return request({
    url: "/equipment/ledger",
    method: "post",
    data: data,
  });
}
// 修改设备
export function updateSb(data) {
  return request({
    url: "/equipment/ledger",
    method: "put",
    data: data,
  });
}
// 删除设备
export function delSb(id) {
  return request({
    url: "/equipment/ledger/delete/id?id=" + id,
    method: "delete",
  });
}
//导出设备
export function exportSb(data) {
  return request({
    url: "/equipment/ledger/export",
    method: "post",
    data
  });
}
//导入
export function importSb(data) {
  return request({
    url: "equipment/ledger/importDataAdd",
    method: "post",
    data
  });
}
//下载模板
export function importTemplate(id) {
  return request({
    url: "/equipment/ledger/importTemplate",
    method: "get",
  });
}

//设备下拉选择
export function treeselectSb(query) {
  return request({
    url: "/equipment/type/treeselect",
    method: "get",
    params: query,
  });
}

// 查询设备维护列表
export function getSbwhList(data) {
  return request({
    url: "/maintenance/man/list",
    method: "post",
    data,
  });
}
//查询设备维护详情

export function detailSbwhList(id) {
  return request({
    url: "/maintenance/man/listTan" + id,
    method: "get",
  });
}
// 新增维护设备
export function addSbwh(data) {
  return request({
    url: "/maintenance/man/add",
    method: "post",
    data: data,
  });
}
// 修改维修设备
export function updateSbwh(data) {
  return request({
    url: "/maintenance/man/update",
    method: "put",
    data: data,
  });
}
// 删除维护设备
export function delSbwh(id) {
  return request({
    url: "/maintenance/man/delete/id?id=" + id,
    method: "delete",
  });
}

// 查询设备类型
export function getSblxlist(data) {
  return request({
    url: "/device/type/list",
    method: "post",
    data,
  });
}
// 新增设备类型
export function addSblx(data) {
  return request({
    url: "/device/typed",
    method: "post",
    data: data,
  });
}
